<script setup lang="ts">
import { usePageConfig } from './config/index.ts'
import { useTable } from '@/hooks/useTable.ts'
import NTableBuilder from '@/components/NTableBuilder/index.vue'
import type { TreeSelectOption } from 'naive-ui'
import routerApi from '@/service/api/router.ts'

defineOptions({
  name: 'RolePage',
})

const treeList = ref<TreeSelectOption[]>()
routerApi.allList().then(({ data }) => {
  treeList.value = data
})
/**
 * 获取页面配置
 * */
const pageConfig = usePageConfig()
const { table, tableProps } = useTable(pageConfig, {
  options: {
    treeList,
  },
})
</script>
<template>
  <n-table-builder v-model="table.tableInfo" v-bind="tableProps" />
</template>

<style lang="scss" scoped></style>
